import { task as http } from '@zh/common-utils/http'

export { http }

/**
 * 待办任务
 * @returns
 */
export function pageTodo (params) {
  return http.post('/task/TcWorktask/page', params)
}

/**
 * 待办任务来源
 * @returns
 */
export function sourceTodo () {
  return http.get('/task/TcWorktask/source')
}

/**
 * 已处理任务分页查询
 * @param {Object} params
 */
export function pageDone (params) {
  return http.post('/task/TcWorktaskHis/page', params)
}
/**
 * 已处理或者抄送件任务搜索任务来源
 * @returns
 */
export function sourceDone () {
  return http.get('/task/TcWorktaskHis/source')
}
/**
 * 抄送任务分页查询
 * @param {*} params
 * @returns
 */
export function pageFyi (params) {
  return http.post('/task/TcWorktaskHis/copyPage', params)
}

/**
 * 抄送任务分页查询
 * @param {*} params
 * @returns
 */
export function pageByType (params) {
  return http.post('/task/TcWorktask/pageByType', params, { repeat: true })
}

/**
 * 抄送任务分页查询
 * @param {*} params
 * @returns
 */
export function stat (params) {
  return http.post('/task/TcWorktask/stat', params)
}
export function getMyTasksCount () {
  return http.get('/task/TcWorktask/getMyTasksCount')
}
export function getMyAppTasksCount (params) {
  return http.get('/task/TcWorktask/getMyAppTasksCount' + params)
}

// 修改任务状态
export function updateTaskStatus (params) {
  return http.post('/task/TcWorktask/updateCopyTaskToHis/' + params)
}

// 待办、待签收数量
export function getWorkTasknNum () {
  return http.get('/task/TcWorktask/selectNeedWorkTask')
}